package design.principle.ocp;

/**
 * @description: java 优惠， 对外扩展
 * @author: liuzhangcheng
 **/
public class JavaDiscountCourse extends JavaCourse {
    public JavaDiscountCourse(String name, Double price) {
        super(name, price);
    }

    @Override
    public Double getPrice() {
        // 8折优惠
        return super.getPrice() * 0.8;
    }

    // 原价
    public Double getOriginPrice() {
        return super.getPrice();
    }
}
